package com.hup.minicontroller.client.config;

import com.hup.minicontroller.client.mvp.IClientHandler.ClientHandlerList;
import com.hup.minicontroller.client.service.LanClientService;
import com.hup.minicontroller.common.SubThreadHandler;
import com.hup.utils.commons.start.ApplicationContext;
import com.hup.utils.commons.start.SimpleExitHandler;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author hugan
 * @date 2020/10/21
 */
@Configuration
public class BeanConfig {

    @Bean
    public SimpleExitHandler exitHandler() {
        return new SimpleExitHandler();
    }

    @Bean
    public ApplicationContext applicationContext() {
        return new ApplicationContext();
    }

    @Bean
    public SubThreadHandler subThreadHandler() {
        return new SubThreadHandler();
    }

    @Bean
    public ClientHandlerList ClientHandlerList(LanClientService lanClientService) {
        ClientHandlerList res = new ClientHandlerList();
        res.add(lanClientService);
        return res;
    }

}
